<template>
  <div class="container">
    <!-- 批次、日龄区间 -->
    <el-form ref="ruleform" :model="ruleform" :inline="true" class="form">
      <el-form-item label="批次号" prop="batch" label-width="60px">
        <el-select v-model="ruleform.batch" placeholder="请选择批次">
          <el-option label="批次一" value="one" />
          <el-option label="批次二" value="two" />
        </el-select>
      </el-form-item>
      <el-form-item label="日龄区间" prop="dayAge" label-width="80px">
        <el-select v-model="ruleform.dayAge" placeholder="请选择区间">
          <el-option label="46 - 60 周" value="1" />
          <el-option label="31 - 45 周" value="2" />
          <el-option label="16 - 30 周" value="3" />
          <el-option label="01 - 15 周" value="4" />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button size="medium" type="primary" @click="$refs['ruleform'].resetFields()">重置</el-button>
      </el-form-item>
    </el-form>
    <!-- 曲线图 -->
    <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
      <!-- 线型图 -->
      <line-chart :chart-data="lineChartData.newVisitis" />
    </el-row>
  </div>
</template>

<script>
// 面板数据
const lineChartData = {
  newVisitis: {
    expectedData: [100, 120, 161, 134, 105, 160, 165],
    actualData: [120, 82, 91, 154, 162, 140, 145]
  },
  messages: {
    expectedData: [200, 192, 120, 144, 160, 130, 140],
    actualData: [180, 160, 151, 106, 145, 150, 130]
  },
  purchases: {
    expectedData: [80, 100, 121, 104, 105, 90, 100],
    actualData: [120, 90, 100, 138, 142, 130, 130]
  },
  shoppings: {
    expectedData: [130, 140, 141, 142, 145, 150, 160],
    actualData: [120, 82, 91, 154, 162, 140, 130]
  }
}
import LineChart from './components/LineChart'
export default {
  name: 'DataCharts',
  components: { LineChart },
  data() {
    return {
      lineChartData, // echarts图数据
      ruleform: {
        batch: '',
        dayAge: ''
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.container{
  padding: 5px;
  .form {
    height: 40px;
    margin: 5px 0;
  }
}
</style>
